﻿using ALMDDD.Domain.Core.Commands;
using ALMDDD.Domain.Core.Events;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ALMDDD.Domain.Core.Bus
{
    /// <summary>
    /// 中介处理程序
    /// </summary>
    public interface IMeDiatorHandler
    {
        /// <summary>
        ///  发布命令，讲命令模型发布到中介者模块
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="command"></param>
        /// <returns></returns>
        Task SendCommand<T>(T command) where T:Command;
        /// <summary>
        /// 引发时间，通过总线，发布事件
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="evnet"></param>
        /// <returns></returns>
        Task RaiseEvent<T>(T @evnet) where T :Event;

    }
}
